<template>
  <view>
    <view class="article-card-v3">
      <view class="article-card-img-wrap">
        <image
          class="article-card-img"
          :src="formatImgUrl(info.avatar)"
          mode="aspectFill"
        />
      </view>
      <view class="article-card-content">
        <view class="article-card-title">{{ info.enterpriseName }}</view>
        <view class="article-card-row">
          <text class="article-card-label">联系人：</text>
          <text class="article-card-value"
            >{{ info.personCharge }} {{ info.enterprisePhonenumber }}</text
          >
        </view>
        <view class="article-card-row">
          <text class="article-card-label">收购品种：</text>
          <text class="article-card-value">{{ info.variety }}</text>
        </view>
        <view class="article-card-row">
          <text class="article-card-label price-label">收购价格区间：</text>
          <text class="article-card-price">{{ info.priceRange }}</text>
        </view>
      </view>
    </view>
    <view class="article-card-divider"></view>
  </view>
</template>

<script>
  import { formatImgUrl } from '../common/utils.js'
  export default {
    name: 'ArticleCardV3',
    props: {
      info: Object
    },
    methods: {
      formatImgUrl
    }
  }
</script>

<style lang="scss" scoped>
  .article-card-v3 {
    display: flex;
    flex-direction: row;
    background: #fff;
    margin: 20rpx 30rpx;
    overflow: hidden;
  }
  .article-card-img-wrap {
    width: 160rpx;
    height: 160rpx;
    background: #eee;
    border-radius: 16rpx;
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .article-card-img {
    width: 160rpx;
    height: 160rpx;
    object-fit: cover;
    display: block;
    border-radius: 16rpx;
  }
  .article-card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding-left: 30rpx;
    min-width: 0;
  }
  .article-card-title {
    font-weight: 600;
    font-size: 34rpx;
    color: #333333;
    word-break: break-all;
    margin-bottom: 16rpx;
  }
  .article-card-row {
    display: flex;
  }
  .article-card-label {
    font-size: 24rpx;
    color: #666666;
    margin-right: 8rpx;
  }
  .price-label {
    color: #ff662a;
  }
  .article-card-value {
    font-size: 24rpx;
    color: #666666;
    word-break: break-all;
  }
  .article-card-price {
    font-size: 24rpx;
    color: #ff662a;
    font-weight: 600;
    margin-left: 8rpx;
  }
  .article-card-divider {
    height: 1rpx;
    background: #eaeaea;
    margin: 0 30rpx;
  }
</style>
